package com.itheima.a08polymorphsm;

public class Test {
    public static void main(String[] args) {
        //创建三个对象并调用
        Person s = new Student("张三",18);
        Person t = new Teacher("王建国",50);
        Person a = new Administrator("小王",30);

        register(s);
        register(t);
        register(a);

    }

    public static void register(Person p){
        p.show();       //根据不同的调用者使用不同的show方法
    }
}
